package com.macro.mall.portal.repository;

import com.macro.mall.portal.domain.MemberReadHistory;
import com.macro.mall.portal.domain.PlantingReadHistory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

/**
 * 会员商品浏览历史Repository
 */
public interface PlantingReadHistoryRepository extends MongoRepository<PlantingReadHistory,String> {
    List<PlantingReadHistory> findByMemberIdAndTypeOrderByCreateTimeDesc(Long memberId,Integer type);
    void deleteAllByMemberId(Long memberId);
    void deleteAllByType(Integer type);

    /**
     * 热门搜索
     * @param type
     * @return
     */
    List<PlantingReadHistory> findByType(Integer type);
}
